<%@ LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
'///////////////////////////////////////////////////////////////////////////////
'// 插件应用:    Z-Blog 1.8 Devo
'// 插件制作:    haphic(http://haphic.esloy.com)
'// 备    注:    Couple 参数设定
'// 最后修改：   2009-12-2
'// 最后版本:    0.4
'///////////////////////////////////////////////////////////////////////////////
%>
<% Option Explicit %>
<% On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<% Response.Buffer=True %>
<!-- #include file="../../../c_option.asp" -->
<!-- #include file="../../../function/c_function.asp" -->
<!-- #include file="../../../function/c_function_md5.asp" -->
<!-- #include file="../../../function/c_system_lib.asp" -->
<!-- #include file="../../../function/c_system_base.asp" -->
<!-- #include file="../../../function/c_system_plugin.asp" -->
<!-- #include file="../../../function/c_system_event.asp" -->
<!-- #include file="../../../plugin/p_config.asp" -->
<%
Call System_Initialize()

'检查非法链接
Call CheckReference("")

'检查权限
If BlogUser.Level>1 Then Call ShowError(6) 

'检查是否启用
If Not LCase(ZC_BLOG_THEME)=LCase("Couple") Then Call ShowError(48) 

Dim strAct : strAct=Request.QueryString("act")
Dim strType : strType=Request.QueryString("type")
Dim strFile : strFile=Request.QueryString("file")
Dim strBuild : strBuild=Request.QueryString("bd")
If (strAct=Empty) And (strType=Empty Or strFile=Empty Or strBuild=Empty) Then Call ShowError(3)

BlogTitle="Couple"


%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=ZC_BLOG_LANGUAGE%>" lang="<%=ZC_BLOG_LANGUAGE%>">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Language" content="<%=ZC_BLOG_LANGUAGE%>" />
	<link rel="stylesheet" rev="stylesheet" href="../../../CSS/admin.css" type="text/css" media="screen" />
	<script language="JavaScript" src="../../../script/common.js" type="text/javascript"></script>
	<style>textarea{line-height:128%;}#bTab{float:right;padding-top:15px;padding-right:20px;}#bTab a{padding:5px 12px;border:1px solid #91ADBF;font-size:18px;font-weight:bold;text-decoration: none;}#bTab a.curr{color:#fff;background:#CFD9DF;}</style>
	<title><%=BlogTitle%></title>
</head>
<body>

			<div id="divMain">
<div class="Header">Couple - 文件修改</div>
<div id="divMain2">
<div id="ShowBlogHint"><%Call GetBlogHint()%></div>
<%
If strAct="lang" Then
	Response.Write "<form id=""edit"" name=""edit"" method=""post"" action=""SaveSetting.asp?act=Lang"">"

	Dim strZC_Lang_ASP,strZC_Lang_JS
	strZC_Lang_ASP=LoadFromFile(BlogPath & "/THEMES/"& ZC_BLOG_THEME &"/PLUGIN/LANGUAGE/doc-asp.asp","utf-8")
	strZC_Lang_JS=LoadFromFile(BlogPath & "/THEMES/"& ZC_BLOG_THEME &"/PLUGIN/LANGUAGE/doc-js.asp","utf-8")

	If strZC_Lang_ASP="" Or strZC_Lang_JS="" Then

		Response.Write "语言包错误, 您可能需要重装主题!</a>."

	Else

		Response.Write "<hr/>"
		Response.Write "<p><b>编辑语言包</b></p>"

		Response.Write "<p id=""bTab""><a id=""bTab1"" class=""curr"" href=""javascript:void(0)"" onclick=""switchTab(1)"">ASP 部分</a> <a id=""bTab2"" href=""javascript:void(0)"" onclick=""switchTab(2)"">JS 部分</a></p>"

		Response.Write "<p style=""color:red;"">※ 注意: 请小心编辑, 语言包的错误可能导致博客无法运行!</p>"
		Response.Write "<p><a href=""javascript:void(0)"" onclick=""loadlang('zh-CN')"">[载入默认语言包]</a> <!--<a href=""javascript:void(0)"" onclick=""loadlang('en')"">[载入英文语言包]</a>--> <a href=""javascript:void(0)"" onclick=""loadlang('doc')"">[载入当前言包]</a></p>"

		strZC_Lang_ASP=TransferHTML(strZC_Lang_ASP,"[textarea]")
		Response.Write "<div id=""tTab""><p id=""tTab1""><textarea class=""resizable"" name=""strZC_Lang_ASP"" id=""strZC_Lang_ASP"" rows=""20"" style=""width:98%;"" >" & strZC_Lang_ASP  & "</textarea></p>"

		strZC_Lang_JS=TransferHTML(strZC_Lang_JS,"[textarea]")
		Response.Write "<p id=""tTab2"" style=""display:none;""><textarea class=""resizable"" name=""strZC_Lang_JS"" id=""strZC_Lang_JS"" rows=""20"" style=""width:98%;"" >" & strZC_Lang_JS  & "</textarea></p></div>"

		Response.Write "<p><input type=""submit"" class=""button"" value=""提交设置"" id=""btnPost"" /> "
		Response.Write "<input type=""reset"" class=""button"" value=""重设"" id=""btnPost2"" /> "
		Response.Write "<input onclick=""history.back(1);"" type=""button"" class=""button"" value=""返回""/></p>"

	End If

Else
	Response.Write "<form id=""edit"" name=""edit"" method=""post"" action=""SaveSetting.asp?act=Edit&amp;bd="&strBuild&"&amp;file="&Server.URLEncode(strFile)&""">"
	If Not InStr(strFile,".")>0 Then

		Response.Write "文件打开有误, 请<a href=""setting.asp"">返回重试</a>."

	Else 

		Dim strZC_File_Content

		strZC_File_Content=LoadFromFile(BlogPath & "/THEMES/"& ZC_BLOG_THEME &"/INCLUDE/"&strFile,"utf-8")

		Response.Write "<hr/>"
		Response.Write "<p><b>编辑文档: "&strFile&"</b></p>"
		Response.Write "<p><a href=""javascript:void(0)"" onclick=""loaddef('"&strFile&"')"">[恢复主题默认内容]</a> <a href=""javascript:void(0)"" onclick=""loadcrr('"&strFile&"')"">[恢复当前自定内容]</a></p>"

		If strType="ml" Then
			strZC_File_Content = TransferHTML(strZC_File_Content,"[textarea]")
			Response.Write "<p><textarea class=""resizable"" name=""strZC_File_Content"" id=""strZC_File_Content"" rows=""20"" style=""width:98%;"" >" & strZC_File_Content  & "</textarea></p>"
		ElseIf strType="sl" Then
			strZC_File_Content = TransferHTML(strZC_File_Content,"[html-format]")
			Response.Write "<p><input type=""text"" name=""strZC_File_Content"" id=""strZC_File_Content"" style=""width:98%;"" value="""& strZC_File_Content &""" /></p>"
		Else

			Response.Write "<p>文本参数错误, 不法确定以何种形式打开文本.</p>"

		End If

		Response.Write "<p><input type=""submit"" class=""button"" value=""提交设置"" id=""btnPost"" /> "
		Response.Write "<input type=""reset"" class=""button"" value=""重设"" id=""btnPost2"" /> "
		Response.Write "<input onclick=""history.back(1);"" type=""button"" class=""button"" value=""返回""/></p>"

		Response.Write "<hr/>"

	End If

End If

%>
</form>
</div>
</div>

<script language="JavaScript" type="text/javascript">
//切换函数
function switchTab(iID){
	$("#bTab>a").removeAttr("class");
	$("#bTab"+iID).attr("class","curr");
	$("#tTab>p").hide();
	$("#tTab"+iID).show();
}

//读取语言包
function loadlang(sFile){
try{
	$("#strZC_Lang_ASP").val("内容载入中, 请稍候...");
	$.get("language/view.asp?file="+sFile+"-asp.asp","",function(data){
	$("#strZC_Lang_ASP").val(data);
	});
	$("#strZC_Lang_JS").val("内容载入中, 请稍候...");
	$.get("language/view.asp?file="+sFile+"-js.asp","",function(data){
	$("#strZC_Lang_JS").val(data);
	});
}catch(e){};
}

//读取当前内容
function loadcrr(sFile){
try{
	$("#strZC_File_Content").val("内容载入中, 请稍候...");
	$.get("../include/"+sFile,"",function(data){
	$("#strZC_File_Content").val(data);
	});
}catch(e){};
}

//读取默认内容
function loaddef(sFile){
try{
	$("#strZC_File_Content").val("内容载入中, 请稍候...");
	$.get("include/"+sFile,"",function(data){
	$("#strZC_File_Content").val(data);
	});
}catch(e){};
}

//延时取消提示
$(document).ready(function(){ 

try{
	//取消提示显示
	setTimeout("$('#ShowBlogHint').slideToggle('slow')",2000);
	//setTimeout("$('#ShowBlogHint').fadeOut('slow')",2000);
	//setTimeout("document.getElementById('ShowBlogHint').style.display='none'",2000);
	}
catch(e){};

});

</script>

</body>
</html>
<%
Call System_Terminate()

If Err.Number<>0 then
  Call ShowError(0)
End If
%>

